<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-capable" content="yes">
<!-- Apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" media="screen"/>
<link href="/public/plugins/layui/css/layui.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/main.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/css/page.css?v=v1.6.7" rel="stylesheet" type="text/css">
<link href="/public/static/admin/font/css/font-awesome.min.css?v=v1.6.7" rel="stylesheet" />
<link href="/public/static/admin/font/css/iconfont.css?v=v1.6.7" rel="stylesheet" />
<!--[if IE 7]>
  <link rel="stylesheet" href="/public/static/admin/font/css/font-awesome-ie7.min.css?v=v1.6.7">
<![endif]-->
<script type="text/javascript">
    var eyou_basefile = "/login.php";
    var module_name = "admin";
    var GetUploadify_url = "/uploads.html";
    // 插件专用旧版上传图片框
    if ('Weapp@execute' == "Admin@index") {
      GetUploadify_url = "/uploads.html";
    }
    var __root_dir__ = "";
    var __lang__ = "cn";
    var __seo_pseudo__ = 3;
    var __web_xss_filter__ = 0;
    var __is_mobile__ = 0;
    var __security_ask_open__ = 0;
</script>
<link href="/public/static/admin/js/jquery-ui/jquery-ui.min.css?v=v1.6.7" rel="stylesheet" type="text/css"/>
<link href="/public/static/admin/js/perfect-scrollbar.min.css?v=v1.6.7" rel="stylesheet" type="text/css"/>
<!-- <link type="text/css" rel="stylesheet" href="/public/plugins/tags_input/css/jquery.tagsinput.css?v=v1.6.7"> -->
<style type="text/css">html, body { overflow: visible;}</style>
<link href="/public/static/admin/css/diy_style.css?v=v1.6.7" rel="stylesheet" type="text/css" />
    <link href="/public/static/admin/css/theme_style.css?v=v1.6.7_1720001269" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/public/static/common/js/jquery.min.js?t=v1.6.7"></script>
<!-- <script type="text/javascript" src="/public/plugins/tags_input/js/jquery.tagsinput.js?v=v1.6.7"></script> -->
<script type="text/javascript" src="/public/static/admin/js/jquery-ui/jquery-ui.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/plugins/layer-v3.1.0/layer.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.cookie.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/admin.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.validation.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/common.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/perfect-scrollbar.min.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/admin/js/jquery.mousewheel.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/plugins/layui/layui.js?v=v1.6.7"></script>
<script type="text/javascript" src="/public/static/common/js/jquery.lazyload.min.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/myFormValidate.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/myAjax2.js?v=v1.6.7"></script>
<script src="/public/static/admin/js/global.js?v=v1.6.7"></script>

<link href="css/index.css" rel="stylesheet" type="text/css" />
    <script src="js/vue.min.js"></script>
    <script src="js/vue-resource.min.js"></script>
    <script src="js/index.js"></script>


</head>
<body class="bodystyle" style="cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page min-hg-c-10" id="app">
        <div class="fixed-bar">
        <div class="item-title">
            <a class="back_xin" href="/login.php?m=admin&c=Index&a=switch_map&lang=cn" title="返回"><i class="iconfont e-fanhui"></i></a>
            <div class="subject">
                <h3>管理员</h3>
                <h5></h5>
            </div>
            <ul class="tab-base nc-row">
                                <li><a href="admin.html" class="tab current"><span>管理员列表</span></a></li>
                                <li><a href="authrule.html" class="tab "><span>角色列表</span></a></li>
                            </ul>
        </div>
    </div>
    <div class="flexigrid">
        <div class="mDiv pt0">
            <div class="ftitle">
                                  <div class="fbutton">
                       <a href="javascript:void(0);" data-href="/admin_add.html" onclick="openFullframe(this, '新增管理员', '100%', '100%');">
                           <div class="add">
                               <span><i class="layui-icon layui-icon-addition"></i>新增管理员</span>
                           </div>
                       </a>
                   </div>
                               </div>
            <form class="navbar-form form-inline" action="/login.php?m=admin&c=Admin&a=index&lang=cn" method="get" onsubmit="layer_loading('正在处理');">
                <input type="hidden" name="m" value="admin"><input type="hidden" name="c" value="Admin"><input type="hidden" name="a" value="index"><input type="hidden" name="lang" value="cn">                <div class="sDiv">
                    <div class="sDiv2">
                            <input type="hidden" name="typeid" value="标题搜索...">
                            <input type="text" size="30" name="keywords" v-model="search"  class="qsbox" placeholder="标题搜索...">
                            <input type="submit" class="btn" @click.prevent="mysearch()" value="搜索">	<i class="iconfont e-sousuo"></i>
                        </div>
                </div>
            </form>
        </div>
        <div class="hDiv">
            <div class="hDivBox">
                <table cellspacing="0" cellpadding="0" style="width: 100%">
                    <thead>
                    <tr>
                                                <th class="sign w40" axis="col0">
                            <div class="tc"><input type="checkbox" class="checkAll"></div>
                        </th>
                                                <th abbr="article_title" axis="col3" class="w40">
                            <div class="tc">ID</div>
                        </th>
                        <th abbr="ac_id" axis="col4">
                            <div class="text-l10">用户名</div>
                        </th>
                        <th abbr="ac_id" axis="col4" class="w150">
                            <div class="tc">真实姓名</div>
                        </th>
                        <th abbr="article_show" axis="col5" class="w150">
                            <div class="tc">角色组</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w120">
                            <div class="tc">手机号码</div>
                        </th>
                        <th abbr="article_time" axis="col6" class="w160">
                            <div class="tc">创建时间</div>
                        </th>
                        <th axis="col1" class="w120">
                            <div class="tc">操作</div>
                        </th>
                    </tr>
                    </thead>
                </table>
            </div>
        </div>
        <div class="bDiv" style="height: auto; min-height: auto;">
            <div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
                <table style="width: 100%">
                    <tbody>
                        <tr v-for="vlist in list">
                                                        <td class="sign">
                                <div class="w40 tc">
                                    <input disabled  type="checkbox" name="ids[]" :value="vlist.admin_id" class="grey">
                                                                    </div>
                            </td>
                                                        <td class="sort">
                                <div class="w40 tc">{{vlist.admin_id}}</div>
                            </td>
                            <td style="width: 100%">
                                <div class="text-l10">
                                                                            <a href="javascript:void(0);" data-href="/login.php?m=admin&c=Admin&a=admin_edit&id=2&iframe=1&lang=cn" onclick="openFullframe(this, '编辑管理员', '100%', '100%');">{{vlist.user_name}}</a>&nbsp;
                                                                        </div>
                            </td>
                            <td>
                                <div class="w150 tc">
                                    {{vlist.true_name}}                                </div>
                            </td>
                            <td>
                                <div class="w150 tc">{{vlist.rule_name}}</div>
                            </td>
                            <td>
                                <div class="w120 tc">
                                      {{vlist.mobile?vlist.mobile:'无'}}                     </div>
                            </td>
                            <td class="">
                                <div class="tc w160">
                                                                {{vlist.add_time}}                               </div>
                            </td>
                            <td class="operation">
                                <div class="w120 tc">
                                                                            <a href="javascript:void(0);" :data-href="'/adminedit.html?id='+vlist.admin_id" class="btn blue" data-closereload="1" onclick="openFullframe(this, '编辑管理员', '100%', '100%');">编辑</a>
                                                                                    <i></i>
                                                <a class="btn grey"  href="javascript:void(0);" data-id="2">删除</a>
                                                                            </div>
                            </td>
                        </tr>
                                            </tbody>
                </table>
            </div>
            <div class="iDiv" style="display: none;"></div>
        </div>
        <div class="tDiv">
            <div class="tDiv2">
                                    <div class="fbutton checkboxall">
                        <input type="checkbox" class="checkAll">
                    </div>
                    <div class="fbutton">
                        <a onclick="batch_del(this, 'ids');" data-url="/login.php?m=admin&c=Admin&a=admin_del&lang=cn" class="layui-btn layui-btn-primary">
                                <span>批量删除</span>
                        </a>
                    </div>
                                    <div class="fbuttonr">
    <div class="pages">
       <div class='dataTables_paginate paging_simple_numbers'><ul class='pagination'>    </ul></div>    </div>
</div>
<div class="fbuttonr">
    
    
    <el-pagination
                      background
                      layout="prev, pager, next"
                      @current-change="handleCurrentChange"
                      :total="count">
                    </el-pagination>
    
    
    <!--<div class="total">-->
    <!--    <h5>共有1条,每页显示-->
    <!--        <select name="pagesize" style="width: 60px;" onchange="ey_selectPagesize(this);">-->
    <!--            <option  value="20">20</option>-->
    <!--            <option  value="50">50</option>-->
    <!--            <option  value="100">100</option>-->
    <!--            <option  selected  value="200">200</option>-->
    <!--        </select>-->
    <!--    </h5>-->
    <!--</div>-->
</div>
            </div>
            <div style="clear:both"></div>
        </div>
       
       </div>
</div>
<input type="hidden" name="head_pic" id="head_pic" value="https://demo.yiyocms.com/uploads/allimg/20240703/1-240F31Q952506.jpg">
<script>
    $(function(){
        $('input[name*=ids]').click(function(){
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked','checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function(){
            $('input[type=checkbox]:not(:disabled)').prop('checked',this.checked);
        });
    });
    
    $(document).ready(function(){
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function(){
            $(this).toggleClass('trSelected');
        });

        // 点击刷新数据
        $('.fa-refresh').click(function(){
            location.href = location.href;
        });

        // 上传头像及时显示
        $('#admin_head_pic', window.parent.document).attr('src', $('#head_pic').val());
    });

    /**
     * 解锁登陆失败锁定的用户名
     * @param  {[type]} obj [description]
     * @return {[type]}     [description]
     */
    function unlock_login(obj)
    {
        var url = $(obj).attr('data-url');
        $.ajax({
            type : 'post',
            url : url,
            data : {_ajax:1},
            dataType : 'json',
            success : function(res){
                if(res.code == 1){
                    layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                        window.location.reload();
                    });
                }else{
                    showErrorMsg(res.msg);
                }
            },
            error: function(e){
                showErrorAlert(e.responseText);
            }
        });
    }

    /*-----------------------------绑定与解绑微信公众号 start------------------------*/

    /*function wechatFollowed(obj, opt) {
        if ('bind' == opt) {
            var admin_id = $(obj).data('id');
            layer_loading('正在加载');
            $.ajax({
                type: 'POST',
                url : "/login.php?m=admin&c=Admin&a=wechat_followed&lang=cn",
                data: {admin_id: admin_id, opt:opt, _ajax: 1},
                dataType: "JSON",
                success: function(res){
                    layer.closeAll();
                    if (1 == res.code) {
                        var htmlContent = '<img src="' + res.url + '?t='+ Math.floor(Math.random()*10000000) +'" style="width: 250px; height: 250px;"><p style="color: red; padding: 8px 0; font-size: 15px; text-align: center;">打开微信扫一扫</p> <script type="text/javascript"> pollingWechatFollowed("' + admin_id + '"); <\/script>';
                        layer.open({
                            type: 1,
                            title:'微信扫码绑定且关注',
                            id: 'layer_wechat_followed',
                            shadeClose: false,
                            content: htmlContent,
                            end: function() {
                                clearWechatFollowed();
                            }
                        });
                    } else {
                        showErrorAlert(res.msg);
                    }
                },
                error: function(e) {
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        } else if ('unbind' == opt) {
            var admin_id = $(obj).data('id');
            layer_loading('正在处理');
            $.ajax({
                type: 'POST',
                url: '/login.php?m=admin&c=Admin&a=wechat_followed&lang=cn',
                data: {admin_id:admin_id, opt:opt, _ajax:1},
                dataType: "JSON",
                success: function(res){
                    layer.closeAll();
                    if (1 == res.code){
                        layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                            window.location.reload();
                        });
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }
    }

    var pollingFollowed = null;
    function pollingWechatFollowed(admin_id) {
        pollingFollowed = setTimeout(function(){
            $.ajax({
                type: 'POST',
                url : "/login.php?m=admin&c=Admin&a=polling_wechat_followed&lang=cn",
                data: {admin_id: admin_id, _ajax:1},
                dataType: "JSON",
                success: function(res) {
                    if (1 == res.data.code) {
                        layer.closeAll();
                        clearWechatFollowed();
                        layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                            window.location.reload();
                        });
                    } else if (0 == res.code) {
                        layer.closeAll();
                        clearWechatFollowed();
                        layer.alert(res.msg, {icon: 5, title: false, closeBtn: false}, function() {
                            window.location.reload();
                        });
                    } else if (2 == res.data.code) {
                        pollingWechatFollowed(admin_id);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    clearWechatFollowed();
                    layer.alert(e.responseText, {icon: 5, title: false, closeBtn: false}, function() {
                        window.location.reload();
                    });
                }
            });
        }, 2000);
    }

    function clearWechatFollowed() {
        if (pollingFollowed > 0) {
            clearTimeout(pollingFollowed);
            pollingFollowed = null;
        }
    }*/

    /*-----------------------------绑定与解绑微信 start------------------------*/

    /**
     * 绑定微信应用
     * @return {[type]} [description]
     */
    var notifyPolling = null;
    function bindWeChat(obj)
    {
        var logintype = $(obj).attr('data-logintype');
        if ('WechatLogin' == logintype) {
            var admin_id = $(obj).attr('data-id');
            var gourl = window.location.href;
            var url = "https://demo.yiyocms.com/login.php?m=admin&c=Admin&a=wechat_bind&lang=cn";
            url += "&admin_id="+admin_id+"&origin=list&gourl="+encodeURIComponent(gourl);
            var iframes = layer.open({
                type: 2,
                title: '微信扫码绑定',
                fixed: true, //不固定
                shadeClose: false,
                shade: layer_shade,
                btnAlign:'r',
                closeBtn: 3,
                // maxmin: true, //开启最大化最小化按钮
                area: ['500px', '460px'],
                content: url
            });
        } else if ('EyouGzhLogin' == logintype) {
            layer_loading('正在加载');
            var admin_id = $(obj).attr('data-id');
            $.ajax({
                type: 'POST',
                url: "/login.php?m=admin&c=Admin&a=mp_getqrcode&lang=cn",
                data: {op:'bind', admin_id:admin_id, _ajax:1},
                dataType: "JSON",
                success: function(res){
                    layer.closeAll();
                    if (1 == res.code) {
                        var html_content = '<img src="https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket='+ res.data.ticket +'" style="width: 250px; height: 250px;"><p style="color: red;padding: 8px 0;font-size: 15px;text-align: center;">打开微信扫一扫</p> <script type="text/javascript"> getNotify("'+admin_id+'","'+res.data.uniqid_scene+'"); <\/script>';
                        layer.open({
                            type: 1,
                            title:'微信扫码绑定',
                            shade: layer_shade,
                            id: 'layer_official_account',
                            shadeClose: false,
                            content: html_content,
                            end: function() {
                                clearNotify();
                            }
                        });
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }
    }

    /**
     * 轮询是否绑定官方公众号
     * @return {[type]} [description]
     */
    function getNotify(admin_id, uniqid_scene){
        notifyPolling = setTimeout(function(){
            $.ajax({
                type: 'POST',
                url: "/login.php?m=admin&c=Admin&a=mp_bingwxgzhopenid&lang=cn",
                data: {op:'bind', admin_id:admin_id, uniqid_scene:uniqid_scene, _ajax:1},
                dataType: "JSON",
                success: function(res){
                    if (1 == res.data.code){
                        layer.closeAll();
                        clearNotify();
                        layer.msg('绑定成功', {shade: layer_shade, time: 1000}, function(){
                            window.location.reload();
                        });
                    } else if (0 == res.code) {
                        layer.closeAll();
                        clearNotify();
                        layer.alert(res.msg, {icon: 5, title:false, closeBtn:false}, function(){
                            window.location.reload();
                        });
                    } else if (2 == res.data.code) {
                        getNotify(admin_id, uniqid_scene);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    clearNotify();
                    layer.alert('扫码检测异常，重新尝试！', {icon: 5, title:false, closeBtn:false}, function(){
                        window.location.reload();
                    });
                }
            });
        }, 1800);
    }

    function clearNotify(){
        if(notifyPolling > 0){
            clearTimeout(notifyPolling);
            notifyPolling = null;
        }
    }

    /**
     * 解除绑定微信应用
     * @return {[type]} [description]
     */
    function unbindWeChat(obj)
    {
        var logintype = $(obj).attr('data-logintype');
        if ('WechatLogin' == logintype) {
            layer_loading('正在处理');
            var admin_id = $(obj).attr('data-id');
            $.ajax({
                type : 'post',
                url : "/login.php?m=admin&c=Admin&a=wechat_unbind_handle&lang=cn",
                data : {admin_id:admin_id, _ajax:1},
                dataType : 'json',
                success : function(res){
                    layer.closeAll();
                    if(res.code == 1){
                        layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                            window.location.reload();
                        });
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        } else if ('EyouGzhLogin' == logintype) {
            layer_loading('正在处理');
            var admin_id = $(obj).attr('data-id');
            $.ajax({
                type: 'POST',
                url: '/login.php?m=admin&c=Admin&a=mp_unbindwx&lang=cn',
                data: {admin_id:admin_id, _ajax:1},
                dataType: "JSON",
                success: function(res){
                    layer.closeAll();
                    if(res.code == 1){
                        layer.msg(res.msg, {shade: layer_shade, time: 1000}, function(){
                            window.location.reload();
                        });
                    }else{
                        showErrorAlert(res.msg);
                    }
                },
                error: function(e){
                    layer.closeAll();
                    showErrorAlert(e.responseText);
                }
            });
        }
    }
</script>

<div id="goTop">
    <a href="JavaScript:void(0);" id="btntop">
        <i class="fa fa-angle-up"></i>
    </a>
    <a href="JavaScript:void(0);" id="btnbottom">
        <i class="fa fa-angle-down"></i>
    </a>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        $('#think_page_trace_open').css('z-index', 99999);
    });
</script>

<script>
    var vm = new Vue({
		el: '#app',
		data: {
			list: [],
			count:0,
			search:"",
			searchstatus:0
		},
		created(){
		  //  let url=window.location.search;
		  //  let urlParams = new URLSearchParams(url);
		  //  this.id=urlParams.get("id");
		  //  this.searchtext=urlParams.get("searchtext");
		    this.details();
		},
		mounted(){
		    
		},
		methods: {
		    details: function() {
			    this.$http.get('api/admin.php').then(function(res){
                    console.log(res.body);   
                    this.list=res.body.data;
                    this.count=res.body.total;
                },function(){
                    console.log('请求失败处理');
                });
			},
			handleCurrentChange:function(p){
			    
                if(this.searchstatus){
                    this.$http.post('api/admin.php',{
    			        page:p,
    			        select:this.searchstatus,
    			        text:this.search
    			    },{emulateJSON: true}).then(function(res){
    			        this.list=res.body.data;
                        this.count=res.body.total;
    			    },function(){
    			        console.log("request fail");
    			    })
                }else{
                    this.$http.post('api/admin.php',{
    			        page:p
    			    },{emulateJSON: true}).then(function(res){
    			        this.list=res.body.data;
                        this.count=res.body.total;
    			    },function(){
    			        console.log("request fail");
    			    })
                }
    			    
			},
			mysearch:function(){

			    this.$http.post('api/admin.php',{
			        text:this.search
			    },{emulateJSON: true}).then(function(res){
			        this.list=res.body.data;
                    this.count=res.body.total;
                    this.searchstatus=res.body.select;
			    },function(){
			        console.log("request fail");
			    })
			}   
		}
	})
</script>


</body>
</html>